package net.lanelife.casino.caipiao.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Index;
import javax.persistence.Table;

import net.lanelife.casino.caipiao.entity.User.AccountType;
import net.lanelife.casino.caipiao.entity.support.UserRelationEntity;
import net.lanelife.casino.common.entity.annotation.Checked;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "TB_REGISTRATION_CODE", indexes = { 
	@Index(name = "IDX_USER_ID", columnList = "USER_ID"),
	@Index(name = "IDX_USER_NAME", columnList = "USER_NAME"),
	@Index(name = "IDX_FLOOR", columnList = "FLOOR"),
	@Index(name = "IDX_PATH", columnList = "PATH"),
	@Index(name = "IDX_PARENT_ID", columnList = "PARENT_ID"),
	@Index(name = "IDX_PARENT_NAME", columnList = "PARENT_NAME")
})
public class RegistrationCode extends UserRelationEntity<Integer> {

	private static final long serialVersionUID = 5493786070988703985L;

	@Checked
	@Enumerated(EnumType.ORDINAL)
	@Column(name = "ACCOUNT_TYPE", nullable = false)
	private AccountType accountType;
	
	@Checked
	@Column(name = "REBATE_POINT", nullable = false)
	private Double rebatePoint;
	
	@Checked
	@Column(name = "AVAILABLE", nullable = false)
	private Boolean available = Boolean.TRUE;

	public AccountType getAccountType() {
		return accountType;
	}

	public void setAccountType(AccountType accountType) {
		this.accountType = accountType;
	}

	public Double getRebatePoint() {
		return rebatePoint;
	}

	public void setRebatePoint(Double rebatePoint) {
		this.rebatePoint = rebatePoint;
	}

	public Boolean getAvailable() {
		return available;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}
	
}
